/* eslint-disable */
/* tslint:disable */
/*
 * ---------------------------------------------------------------
 * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API        ##
 * ##                                                           ##
 * ## AUTHOR: acacode                                           ##
 * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
 * ---------------------------------------------------------------
 */

import { AxiosResponse } from 'axios'
import {
  FormAddInput,
  FormAddItemInput,
  FormUpdateInput,
  PageInputFormGetPageDto,
  ResultOutputFormDetailOutput,
  ResultOutputInt64,
  ResultOutputPageOutputFormOutput,
} from './data-contracts'
import { ContentType, HttpClient, RequestParams } from './http-client'

export class FormApi<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
  /**
   * No description
   *
   * @tags form
   * @name Add
   * @summary 新增
   * @request POST:/api/admin/form/add
   * @secure
   */
  add = (data: FormAddInput, params: RequestParams = {}) =>
    this.request<ResultOutputInt64, any>({
      path: `/api/admin/form/add`,
      method: 'POST',
      body: data,
      secure: true,
      type: ContentType.Json,
      format: 'json',
      ...params,
    })
  /**
 * No description
 *
 * @tags form
 * @name Update
 * @summary 修改
目前无限制
 * @request PUT:/api/admin/form/update
 * @secure
 */
  update = (data: FormUpdateInput, params: RequestParams = {}) =>
    this.request<AxiosResponse, any>({
      path: `/api/admin/form/update`,
      method: 'PUT',
      body: data,
      secure: true,
      type: ContentType.Json,
      ...params,
    })
  /**
   * No description
   *
   * @tags form
   * @name GetPage
   * @summary 分页获取
   * @request POST:/api/admin/form/get-page
   * @secure
   */
  getPage = (data: PageInputFormGetPageDto, params: RequestParams = {}) =>
    this.request<ResultOutputPageOutputFormOutput, any>({
      path: `/api/admin/form/get-page`,
      method: 'POST',
      body: data,
      secure: true,
      type: ContentType.Json,
      format: 'json',
      ...params,
    })
  /**
   * No description
   *
   * @tags form
   * @name Get
   * @summary 获取
   * @request GET:/api/admin/form/get
   * @secure
   */
  get = (
    query?: {
      /** @format int64 */
      id?: number
    },
    params: RequestParams = {}
  ) =>
    this.request<ResultOutputFormDetailOutput, any>({
      path: `/api/admin/form/get`,
      method: 'GET',
      query: query,
      secure: true,
      format: 'json',
      ...params,
    })
  /**
   * No description
   *
   * @tags form
   * @name SetItems
   * @summary 设置表单项
   * @request POST:/api/admin/form/set-items
   * @secure
   */
  setItems = (data: FormAddItemInput, params: RequestParams = {}) =>
    this.request<AxiosResponse, any>({
      path: `/api/admin/form/set-items`,
      method: 'POST',
      body: data,
      secure: true,
      type: ContentType.Json,
      ...params,
    })
}
